#ifndef _REDIS_REDIS_CONTEXT_POOL_H_
#define _REDIS_REDIS_CONTEXT_POOL_H_

#include <hiredis/hiredis.h>

#include "base/object_pool.h"

using namespace std;
using namespace base;

class RedisContextPool : public ObjectPool<redisContext> {
 public:
  static RedisContextPool & Instance() {
    static RedisContextPool instance;
    return instance;
  }
 protected:
  virtual redisContext * Create(const std::string & key);
  virtual void Destroy(redisContext * context);
};

#endif // _REDIS_REDIS_CONTEXT_POOL_H_

